package com.robinmouren.service;

import com.robinmouren.dto.ClientOrderDto;
import com.robinmouren.dto.QuotationDto;
import com.robinmouren.entity.OrderInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.robinmouren.exception.BaseException;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author Robinmouren
 * @since 2024-05-12
 */
public interface IOrderService extends IService<OrderInfo> {


    /**
     * 客户端创建询价单
     * @param quotationDto
     */
    @Transactional(rollbackFor = BaseException.class)
    void quotationCreate(QuotationDto quotationDto);


    /**
     * 获取订单信息，根据订单号
     * @param orderNumber
     * @return
     */
    QuotationDto getByOrderNumber(String orderNumber);


    /**
     * 订单修改状态
     * @return
     */
    void quotationStatusUpdate(String orderNumber, Integer code);

    /**
     * 询价单添加审核意见
     * @param orderNumber
     * @param opinion
     */
    void quotationAuditOpinion(String orderNumber, String opinion);


    /**
     * 客户下订单
     * @param dto
     */
    void clientPlaceOrder(ClientOrderDto dto);


    /**
     * 根据订单号取消所有拆分信息
     * @param orderNumber
     */
    void cancelSplit(String orderNumber);
}
